import { App } from 'vue'

import {
  // 表单
  ElCascader,
  ElCheckboxGroup,
  ElCheckbox,
  ElCheckboxButton,
  ElColorPicker,
  ElDatePicker,
  ElInput,
  ElInputNumber,
  ElRadioGroup,
  ElRadio,
  ElRadioButton,
  ElRate,
  ElSelect,
  ElOption,
  ElOptionGroup,
  ElSlider,
  ElSwitch,
  ElTimePicker,
  ElTimeSelect,
  ElTransfer,
  ElUpload,
  ElButton
} from 'element-plus'

// 全局注册element-plus部分组件
export default {
  install(app: App) {
    // 注册表单组件
    app.component(ElCascader.name, ElCascader)
    app.component(ElCheckboxGroup.name, ElCheckboxGroup)
    app.component(ElCheckbox.name, ElCheckbox)
    app.component(ElCheckboxButton.name, ElCheckboxButton)
    app.component(ElColorPicker.name, ElColorPicker)
    app.component(ElDatePicker.name, ElDatePicker)
    app.component(ElInput.name, ElInput)
    app.component(ElInputNumber.name, ElInputNumber)
    app.component(ElRadioGroup.name, ElRadioGroup)
    app.component(ElRadio.name, ElRadio)
    app.component(ElRadioButton.name, ElRadioButton)
    app.component(ElRate.name, ElRate)
    app.component(ElSelect.name, ElSelect)
    app.component(ElOption.name, ElOption)
    app.component(ElOptionGroup.name, ElOptionGroup)
    app.component(ElSlider.name, ElSlider)
    app.component(ElSwitch.name, ElSwitch)
    app.component(ElTimePicker.name, ElTimePicker)
    app.component(ElTimeSelect.name, ElTimeSelect)
    app.component(ElTransfer.name, ElTransfer)
    app.component(ElUpload.name, ElUpload)
    app.component(ElButton.name, ElButton)
  }
}
